<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>挂单列表</title>
<!--公共样式开始-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/reset.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/common.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Plugins/FontAwesome/css/font-awesome.min.css">
<!--公共样式结束-->
<!--公共JS开始-->
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.min.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.timer.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/common.js"></script>
<!--公共JS结束-->
<!--数据列表插件开始-->
<link href="{$NOW_THEME_URL}/Assets/Plugins/ContextMenu/src/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="{$NOW_THEME_URL}/Assets/Plugins/ContextMenu/src/jquery.ui.position.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Plugins/ContextMenu/src/jquery.contextMenu.js"></script>
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Plugins/Etgrid/Css/etgrid.css">
<script src="{$NOW_THEME_URL}/Assets/Plugins/Etgrid/Js/etgrid.js"></script>
<!--数据列表插件结束-->
<!--ZTree开始-->
<link rel="stylesheet" href="{$NOW_THEME_URL}/Assets/Plugins/ZTree/css/zTreeStyle/zTreeStyle.css" type="text/css">
<include file="treeColumn" />
<script type="text/javascript" src="{$NOW_THEME_URL}/Assets/Plugins/ZTree/js/jquery.ztree.core-3.5.js"></script>
<!--ztree结束-->
<style type="text/css">
	body {
		overflow:hidden;
	}
	.table_box {
	}
</style>
</head>

<body>
	<div class="page_header">
		<div class="table_tool">
			<ul class="clearfix">			
				<li class="productDel btn"><i class="icon-remove"></i> 批量删除</li>
				<li class="line"></li>
				<li class="productDel btn"><i class="icon-remove"></i> 解挂</li>
			</ul>
		</div>
		<div class="search_box">
			<input type="text" id="keywords" class="form_ele w300" placeholder="请输入挂单说明"/>
			<span id="doSearch" class="doSearch">
				<i class="icon-search"></i> 搜索
			</span>
		</div>
	</div>
	<div class="yhlist clearfix">
		<div class="table_box" style="border-left:1px solid #999;">
			<table style="width:100%">
				<thead>
					<tr>
						<td>卡号</td>
						<td>挂单说明</td>
						<td>创建者</td>
						<td>创建日期</td>
						<td>操作</td>
					</tr>
				</thead>
				<tbody>
					<volist name="list" id="v">
						<tr>
							<td>
								<eq name="v.tableid" value="Guest">
									非会员
								<else/>
									{$v.dataid}
								</eq>
							</td>
							<td>{$v.content}</td>
							<td>{$v.addno}</td>
							<td>{$v.addtime|date="Y-m-d H:i:s",###}</td>
							<td><span billid="{$v.id}" class="dealbtn">解挂</span></td>
						</tr>
					</volist>
				</tbody>
			</table>
		</div>
	</div>
</body>
<script type="text/javascript">
	//批量删除
	$('.productDel').on('click',function(){

		var val = tableList.getChecked();
		var msg = "确认要将选中的商品删除吗？";
		
		if(val){
			windowApi.lhgdialog.confirm(msg, function(){
				$.post("{:U('Product/del')}",{val:val},function(data){
					if(data.status==1){
						$('.et_tfoot .page_refresh').click(); //刷新加载
					}else{
						windowApi.lhgdialog.alert(data.info,function(){return;});
					}
				});
			},function(){
				return;
			});
		}else{
			windowApi.lhgdialog.alert('请选择需要删除的商品！',function(){return;});
		}
	});
	
	//解挂
	$('.dealbtn').on('click',function(){
		
		var billid = $(this).attr("billid");
		
		$.get("{:U('Sell/unlockOrder')}",{billid:billid},function(data){
			if(data.status==1){
				var obj = windowApi.lhgdialog.list['Sell_index'];
				obj.reload(obj); //指定刷新某个窗口
			}else{
				windowApi.lhgdialog.alert(data.info,function(){return;});
			}
			frameApi.close(); //关闭当前窗口
		})
	})
	
</script>
</html>
